import { Component, OnInit, OnDestroy, Input, Output, EventEmitter } from '@angular/core';
import {User} from '../user';

@Component({
  selector: 'app-test-detail',
  templateUrl: './test-detail.component.html',
  styleUrls: ['./test-detail.component.css']
})
export class TestDetailComponent implements OnInit, OnDestroy {
  @Input() user: User;
  @Input() preffix: string;
  @Output() dataLoaded = new EventEmitter<User>();
  style = {width: '300px', fontSize: '18px'};
  constructor() { }

  ngOnInit() {
    this.dataLoaded.emit(this.user);
  }
  ngOnDestroy() {
  }
  submitForm(ngForm) {
    this.log(ngForm);
  }
  private log(logText: string) {
    console.log(logText);
  }
}
